<html>
<head><meta charset="utf-8"><title>ucg#102 · t-lang/wg-unsafe-code-guidelines · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/index.html">t-lang/wg-unsafe-code-guidelines</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg.23102.html">ucg#102</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="160945777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg%23102/near/160945777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg.23102.html#160945777">(Mar 16 2019 at 10:24)</a>:</h4>
<p><span class="user-mention" data-user-id="124289">@rkruppe</span> can we answer the question about how big can Rust values be here ?</p>



<a name="160945837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg%23102/near/160945837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg.23102.html#160945837">(Mar 16 2019 at 10:26)</a>:</h4>
<p>the PR documents the bounds that <code>usize</code> sets because of its use on APIs (<code>size_of</code>/<code>size_of_val</code>, <code>[T; N]</code>, <code>ptr.add</code>, etc.) and then it documents the bounds of the current implementation<br>
but guaranteeing the size of Rust values feels RFC worthy</p>



<a name="160945846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg%23102/near/160945846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg.23102.html#160945846">(Mar 16 2019 at 10:26)</a>:</h4>
<p>for an MVP _implementation-defined_ isn't that bad IMO</p>



<a name="160945964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg%23102/near/160945964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg.23102.html#160945964">(Mar 16 2019 at 10:30)</a>:</h4>
<p>The "bounds set because of APIs" angle doesn't really get to the core of the matter because any one of those just means you can't use that API to work with larger data. But the limitations are more fundamental because they also affect e.g. our codegen for primitive operations such as field or array element projection</p>



<a name="160945987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg%23102/near/160945987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg.23102.html#160945987">(Mar 16 2019 at 10:31)</a>:</h4>
<p>It's useful to document those for sure, but it seems we can't really say anything about the more fundamental limitation without an RFC. Even saying it's impl-defined just punts the issue to the part of the docs that describe rustc's choice of impl-defined parameters, and we can't write those without an RFC either.</p>



<a name="160946031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg%23102/near/160946031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg.23102.html#160946031">(Mar 16 2019 at 10:32)</a>:</h4>
<p>Well, I suppose almost everything in the UCG is provisional without an RFC ratifying it but still</p>



<a name="160946101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg%23102/near/160946101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg.23102.html#160946101">(Mar 16 2019 at 10:34)</a>:</h4>
<p>One thing we discussed in the next meeting is identifying things that would be RFC worthy, but not belong in the UCG RFC. I think this would be one of those. I'll just change this from "implementation-defined" to "this is how it currently works" but this has not been RFC'ed/</p>



<a name="160946192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg%23102/near/160946192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/ucg.23102.html#160946192">(Mar 16 2019 at 10:37)</a>:</h4>
<p>done, I'll recycle the issue to track a separate RFC for this - we wanted to start triaging these things next week anyways</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>